-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Conversation
@@ -144,7 +144,7 @@ enum flags | |||
|
|||
|
|||
/* Map for errno-related constants | |||
* |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Change looks good! The only question is how could one test it? |
For testing, not sure the best way to keep this clean, but this works (also I do not know why my conditional with
diff --git a/Makefile b/Makefile
index 62009ff..5624be1 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,8 @@
# IN THE SOFTWARE.
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
+HELPER ?=
+BINEXT ?=
ifeq (darwin,$(PLATFORM))
SONAME ?= libhttp_parser.2.5.0.dylib
SOEXT ?= dylib
@@ -26,7 +28,14 @@ else
SONAME ?= libhttp_parser.so.2.5.0
SOEXT ?= so
endif
-CC?=gcc
+
+CC ?= winegcc
+SONAME ?= libhttp_parser.2.5.0.dll
+SOEXT ?= dll
+BINEXT ?= .exe.so
+HELPER ?= wine
+
+# CC?=gcc
AR?=ar
CPPFLAGS ?=
@@ -58,8 +67,8 @@ LDFLAGS_LIB += -Wl,-soname=$(SONAME)
endif
test: test_g test_fast
- ./test_g
- ./test_fast
+ $(HELPER) test_g$(BINEXT)
+ $(HELPER) test_fast$(BINEXT)
test_g: http_parser_g.o test_g.o
$(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@
@@ -86,7 +95,7 @@ http_parser.o: http_parser.c http_parser.h Makefile
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c
test-run-timed: test_fast
- while(true) do time ./test_fast > /dev/null; done
+ while(true) do time $(HELPER) ./test_fast$(BINEXT) > /dev/null; done
test-valgrind: test_g
valgrind ./test_g
@@ -107,10 +116,10 @@ url_parser_g: http_parser_g.o contrib/url_parser.c
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@
parsertrace: http_parser.o contrib/parsertrace.c
- $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace
+ $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace$(BINEXT)
parsertrace_g: http_parser_g.o contrib/parsertrace.c
- $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g
+ $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g$(BINEXT)
tags: http_parser.c http_parser.h test.c
ctags $^
@@ -133,7 +142,8 @@ uninstall:
clean:
rm -f *.o *.a tags test test_fast test_g \
http_parser.tar libhttp_parser.so.* \
- url_parser url_parser_g parsertrace parsertrace_g
+ url_parser url_parser_g parsertrace parsertrace_g \
+ *.exe *.exe.so
contrib/url_parser.c: http_parser.h
contrib/parsertrace.c: http_parser.h |
I made this work with Travis, but I do not know if this is wanted. Reasoning is because it takes much longer to install Wine. It would be better to make a matrix more proper where a separate box only installs Wine, runs According to Travis documentation, only compiler:
- clang
- gcc
env:
- nothing=1
- PLATFORM=wine
matrix:
exclude:
- compiler: clang
env: PLATFORM=wine
script: "make -e" This way you create (2x2)-1 build matrix. And use |
@Tatsh I'd rather remove it from travis. |
As long as you have Wine installed ( As requested, the style change was removed, and the |
PR-URL: #259 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Landed in b36c2a9, thank you! |
This makes the project work with
winegcc
.